#include<iostream>
#include<cstring>
using namespace std;
char yuanyin[5] = { 'a','e','i','o','u' };
int main()
{
	char arr[1100];
	int n;
	cin >> n;
	while (n--)
	{
		fgets(arr, 1100, stdin);
		int len = strlen(arr);
		for (int i = 0; i < len; i++) {
			for (int j = 0; j < 5; j++) {
				if (arr[i] == yuanyin[j])
				{
					yuanyin[j]++;
				}
			}
		}
		for (int i = 0; i < 5; i++) {
			cout << (char)yuanyin[i] << " " << yuanyin[i] << endl;
		}
		cout << endl;
	}
	return 0;
}